﻿using Basic.HrGatewayModular.Interface;
using Basic.HrGatewayModular.Model.EmpFile;
using Basic.HrRemoteModel.EmpFile;
using Basic.HrRemoteModel.EmpFile.Model;

namespace Basic.HrGatewayModular.Services
{
    internal class EmpSelfFileService : IEmpSelfFileService
    {
        public long Add ( long empId, EmpFileAdd add )
        {
            return new AddEmpFile
            {
                Datum = new EmpSelfFileAdd
                {
                    Classify = add.Classify,
                    EmpId = empId,
                    FileId = add.FileId,
                    FileUri = add.FileUri,
                }
            }.Send();
        }

        public void Delete ( long id )
        {
            new DeleteEmpFile
            {
                Id = id
            }.Send();
        }
        public EmpFileDto FindLast ( long empId, string classtify )
        {
            return new FindLastEmpFile
            {
                Classtify = classtify,
                EmpId = empId
            }.Send();
        }

        public EmpFileDto[] Gets ( long empId, string classtify )
        {
            return new GetEmpFiles
            {
                Classify = classtify,
                EmpId = empId,
            }.Send();
        }
    }
}
